package ciyuan.dataStore;

import ciyuan.wrap.Wrapper;

public class Config {

    public String CheckLoginURL = "";
    public String KickMessage = "";
    public String StopInteractMessage = "";
    public String KickBlackMessage = "";
    public String ServerName = "";
    public String SuccessMsg = "";
    public boolean OnlyKickBlack = false;
    public boolean CheckLinkUpdate = true;
    public long IpTimeoutSeconds = 0;

    public Config(Object config) {
        Wrapper.INSTANCE.configAddDefault(config, "CheckLoginURL", "https://www.cywtb.cn/api");
        Wrapper.INSTANCE.configAddDefault(
            config,
            "KickMessage",
            "§7[ §6QQ联合登录 §7]\n\n§c§l登录失败\n§f你没有在QQ频道登录\n\n§c§l使用链接加入频道\n§f§nhttps://pd.qq.com/s/esw6pkemn"
        );
        Wrapper.INSTANCE.configAddDefault(config, "StopInteractMessage", "§7[ §6QQ联合登录 §7] §f正在等待验证...请不要交互");
        Wrapper.INSTANCE.configAddDefault(config, "KickBlackMessage", "§7[ §6QQ联合登录 §7] §f黑名单用户踢出");
        Wrapper.INSTANCE.configAddDefault(config, "ServerName", "DefaultServer");
        Wrapper.INSTANCE.configAddDefault(config, "OnlyKickBlack", false);
        Wrapper.INSTANCE.configAddDefault(config, "CheckLinkUpdate", true);
        Wrapper.INSTANCE.configAddDefault(config, "SuccessMsg", "§7[ §6QQ联合登录 §7] §f登录§a§n完成§f，你可以正常游玩了");
        Wrapper.INSTANCE.configAddDefault(config, "IpTimeoutSeconds", 60 * 60);

        Wrapper.INSTANCE.saveConfig(config);

        CheckLoginURL = Wrapper.INSTANCE.configGetString(config, "CheckLoginURL");
        KickMessage = Wrapper.INSTANCE.configGetString(config, "KickMessage");
        StopInteractMessage = Wrapper.INSTANCE.configGetString(config, "StopInteractMessage");
        ServerName = Wrapper.INSTANCE.configGetString(config, "ServerName");
        OnlyKickBlack = Wrapper.INSTANCE.configGetBoolean(config, "OnlyKickBlack");
        CheckLinkUpdate = Wrapper.INSTANCE.configGetBoolean(config, "CheckLinkUpdate");
        KickBlackMessage = Wrapper.INSTANCE.configGetString(config, "KickBlackMessage");
        SuccessMsg = Wrapper.INSTANCE.configGetString(config, "SuccessMsg");
        IpTimeoutSeconds = Wrapper.INSTANCE.configGetLong(config, "IpTimeoutSeconds");
    }


}
